
package cfar.actors;

import cfar.ff.data.Unit;
import cfar.actors.distributed.Signal;

import java.io.Serializable;

/**
 *
 * @author badi
 */
public final class Message<A> implements Serializable {

    public final cfar.actors.Signal signal;
    public final A payload;
    
    public Message(final cfar.actors.Signal s, final A p){
        signal = s;
        payload = p;
    }

    public static Message<Unit> stop = new Message(Signal.Stop, Unit.unit());

    public static Message<Unit> close = new Message(Signal.Close, Unit.unit());


    public String toString(){
        return "Message(" + signal + ", " + payload + ")";
    }

}
